import type { Metadata } from "next";
import style from "./index.module.scss";
import Header from "@/app/components/Header";
import { getRecommendDetail } from "@/service/oldResume";
import Footer from "@/app/components/Footer";
import RightContent from "@/app/components/RightContent";

export const metadata: Metadata = {};

export default async function Home({ params }) {
  const { id } = params;
  const res = await getRecommendDetail({
    id,
  });
  const data = res.data || {};
  data.title = data.title.replace(/简小历|简历在线/g, "百捷简历");
  data.description = data.description.replace(/简小历|简历在线/g, "百捷简历");
  data.content = data.content.replace(/简小历|简历在线/g, "百捷简历");
  metadata.title = data.title;
  metadata.description = data.description;
  metadata.keywords = "简历范文，简历模板范文、简历撰写技巧、求职面试攻略";
  return (
    <>
      <Header current="recommend" style={{ background: "#fff" }} />
      <main className={style.main}>
        <div className={style.container}>
          <div className={style.left}>
            <h1 className={style.title}>{data?.title}</h1>
            <h4 className={style.description}>{data?.description}</h4>

            <div
              className={style.innerHTML}
              dangerouslySetInnerHTML={{ __html: data?.content || "" }}
            ></div>
          </div>
          <div className={style.right}>
            <RightContent fromList={false} />
          </div>
        </div>
        <Footer />
      </main>
    </>
  );
}
